Skip to content

fix(ui): add loading state for translation status generated time#2589

Merged
ghostdevv merged 2 commits intonpmx-dev:mainfrom
cylewaitforit:translation-status-loading-gat
Apr 20, 2026
Merged

fix(ui): add loading state for translation status generated time#2589
ghostdevv merged 2 commits intonpmx-dev:mainfrom
cylewaitforit:translation-status-loading-gat

Conversation

@cylewaitforit
Copy link
Copy Markdown
Contributor

@cylewaitforit cylewaitforit commented Apr 20, 2026

🔗 Linked issue

#2588

🧭 Context

Adds loading state when "generated at date" is not available.

before (current date, not real date) after (skeleton while real date is loading)
image image

📚 Description

Previously the page would show the current date and time before the data loaded. Not only is it incorrect information but would cause the visual regression tests to consistently need updating.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Apr 20, 2026 1:03pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Apr 20, 2026 1:03pm
npmx-lunaria Ignored Ignored Apr 20, 2026 1:03pm

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 81626399-4ed3-415d-a965-5838580feaf1

📥 Commits

Reviewing files that changed from the base of the PR and between 2413d58 and 871d367.

📒 Files selected for processing (1)
  • app/pages/translation-status.vue
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/pages/translation-status.vue

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved translation status "generated at" timestamp display. The interface now displays a loading skeleton when data is unavailable, eliminating inaccurate auto-generated fallback timestamps. Users receive clearer visual feedback during data retrieval, and only reliable, actual timestamp information is shown when available. This enhances overall data integrity and user experience.

Walkthrough

Removed the fallback timestamp behaviour from the translation status page: generatedAt is now derived strictly from status.value?.generatedAt. The template shows a SkeletonInline while loading or when generatedAt is absent, and only renders the i18n-t output when generatedAt is present.

Changes

Cohort / File(s) Summary
Timestamp Display Logic
app/pages/translation-status.vue
Removed useNuxtApp() / nuxt.isHydrated / import.meta.client fallback that inserted new Date().toISOString(); generatedAt now equals status.value?.generatedAt only. Template updated to show SkeletonInline when isLoading or generatedAt is falsy and to render i18n-t only when generatedAt exists.

Possibly related issues

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title directly describes the main change: adding a loading state for the translation status generated timestamp.
Description check ✅ Passed The description is clearly related to the changeset, explaining the problem (incorrect timestamp before data loads) and the solution (showing a loading skeleton instead).

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@cylewaitforit
Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 20, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
app/pages/translation-status.vue (1)

20-20: Remove the no-op hydration branch.

nuxt.isHydrated ? gat : gat now returns the same value on both paths, so the computed can be collapsed and useNuxtApp() can be dropped if it is no longer used elsewhere.

♻️ Proposed simplification
-const nuxt = useNuxtApp()
 const router = useRouter()
 const canGoBack = useCanGoBack()
 const { fetchStatus, status } = useI18nStatus()
@@
-const generatedAt = computed(() => {
-  const gat = status.value?.generatedAt
-  if (import.meta.client) {
-    return nuxt.isHydrated ? gat : gat
-  }
-
-  return gat
-})
+const generatedAt = computed(() => status.value?.generatedAt)

Also applies to: 31-38

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/pages/translation-status.vue` at line 20, The conditional branch using
nuxt.isHydrated that returns the same value on both sides is a no-op; remove the
useNuxtApp() call and simplify the computed expression to return the single
value directly. Locate the call to useNuxtApp() (nuxt) and the computed that
does "nuxt.isHydrated ? gat : gat" and replace the computed with just the "gat"
expression (and delete the useNuxtApp() import/call if it's unused elsewhere);
apply the same collapse to the similar pattern in the other computed/blocks
referenced (lines 31–38).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@app/pages/translation-status.vue`:
- Line 20: The conditional branch using nuxt.isHydrated that returns the same
value on both sides is a no-op; remove the useNuxtApp() call and simplify the
computed expression to return the single value directly. Locate the call to
useNuxtApp() (nuxt) and the computed that does "nuxt.isHydrated ? gat : gat" and
replace the computed with just the "gat" expression (and delete the useNuxtApp()
import/call if it's unused elsewhere); apply the same collapse to the similar
pattern in the other computed/blocks referenced (lines 31–38).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 511f4fb5-9003-47ce-bbb6-e9e38255f0f9

📥 Commits

Reviewing files that changed from the base of the PR and between 4e7eb1d and a272ff5.

📒 Files selected for processing (1)
  • app/pages/translation-status.vue

@ghostdevv ghostdevv enabled auto-merge April 20, 2026 13:01
@ghostdevv ghostdevv added this pull request to the merge queue Apr 20, 2026
Merged via the queue into npmx-dev:main with commit 94ef76d Apr 20, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants